<?php

class CommentAction extends BaseAction {
	
	public function index() {
		$list = D("comment")->select();
		$this->assign('ab',$list);
		$this->display("Index:message");
	}
	
	public function submit() {
		$pd = $_POST;
		$pd['cTime'] = time();
		$pd['name'] = htmlspecialchars($pd['name']);
		$pd['comment'] = htmlspecialchars($pd['comment']);
		dump($pd);
		D("comment")->add($pd);
		$this->redirect("index/", null, 3, htmlentities($pd['comment']));
	}
}
?>